home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1214_slow_mail_delivery_and_timeouts.rtf < prev    next >
Text File  |  1995-06-12  |  3KB  |  75 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Ohlfs;}
  2. \paperw11560
  3. \paperh9120
  4. \margl120
  5. \margr1000
  6. {\colortbl;\red0\green0\blue0;\red82\green82\blue82;\red83\green83\blue83;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fi-380\li380\fc1\cf1 Q: Why is sendmail timing out to my local mailhost?\
  8. \
  9.  
  10. \fi0\li0 Q: Why do I get "connection timed out" messages while trying to connect to my local mailhost.  When I log in to the mailhost, it seems lightly loaded?\
  11.  
  12. \fi-380\li380 \
  13. Q: Why is mail taking so long to deliver locally?\
  14.  
  15. \fi0\li0 \
  16. A: There are probably several possible answers to these questions.  Here is one of them.\
  17. \
  18. Mail gets queued up in /usr/spool/mqueue using two different files for each piece of mail.  One file is the header information for the mail, and the other file is the body of the message.  The directory /usr/spool/mqueue, like all directories, is simply a file that contains a listing of filenames and their associated inodes that are contained in the directory.  The size of a directory is usually around 1 or 2 kilobytes.  The more files you have in a directory and the longer the names of the files, the larger the size of the directory file is.  The size of the directory file never decreases.\
  19. \
  20. Whenever a file is created the system must open up the directory file and write some information into it.  The larger the directory file is, the longer it takes to read through it and add the new entry.  The same thing is true for deleting files.\
  21. \
  22. If you have a mail server that deals with a lot of traffic and something causes the mail to get backed up in the queue, the directory file can grow very large (50+ KB) storing the names of the backed up mail.  Even after clearing the entire queue, the size of the directory file remains the same, and creating and destroying files in that directory starts taking a significant amount of time.  In fact, the mail server can become so slow that connections to it start timing out even though the machine seems to be very responsive.\
  23. \
  24. The only solution is to create a new mqueue directory:\
  25. \
  26. 1. Find the incoming sendmail process and kill it.\
  27. \
  28.  
  29. \f2\fs20     % ps auxw | grep sendmail\
  30.     root       206   0.0  0.8 1.55M  312K ?  S     0:04 -accepting connections     (sendmail)\
  31.     % kill <PID>
  32. \f0\fs28     
  33. \i # PID is 206 in the above example
  34. \i0 \
  35.     \
  36. 2. Wait for the outgoing sendmail processes to finish.\
  37. \
  38.  
  39. \f2\fs20     % ps auxw | grep sendmail\
  40.  
  41. \f0\fs28 \
  42. You can keep running the above command until all of the outgoing sendmail processes have died or you can go ahead and kill them all.  Sendmail should be tolerant of getting killed.\
  43. \
  44. 3. Move /usr/spool/mqueue to /usr/spool/mqueue.old and create a new mqueue\
  45. \
  46.  
  47. \f2\fs20     % cd /usr/spool\
  48.     % mv mqueue mqueue.old\
  49.     % mkdir mqueue\
  50.  
  51. \f0\fs28 \
  52. 5. Move all of the files from mqueue.old into the new mqueue directory\
  53. \
  54.  
  55. \f2\fs20     % mv mqueue.old/*  mqueue\
  56.  
  57. \f0\fs28 \
  58. 6. Remove old mqueue directory\
  59. \
  60.  
  61. \f2\fs20     % rmdir mqueue.old\
  62.  
  63. \f0\fs28 \
  64. 6. Restart sendmail\
  65. \
  66.  
  67. \f2\fs20     % /usr/lib/sendmail -bd -q30m\
  68.  
  69. \f0\fs28 \
  70. QA876\
  71. \
  72. Valid for 1.0, 2.0, 3.0\
  73. \
  74.  
  75.